using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIEvent_UICircleCollider_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIEvent.UICircleCollider);
            args = new Type[]{typeof(huqiang.Core.HGUI.UIElement), typeof(huqiang.UIEvent.UserEvent), typeof(UnityEngine.Vector2)};
            method = type.GetMethod("InThere", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, InThere_0);
            args = new Type[]{typeof(huqiang.Data.FakeStruct)};
            method = type.GetMethod("Initial", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Initial_1);

            field = type.GetField("Radius", flag);
            app.RegisterCLRFieldGetter(field, get_Radius_0);
            app.RegisterCLRFieldSetter(field, set_Radius_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Radius_0, AssignFromStack_Radius_0);
            field = type.GetField("Ratio", flag);
            app.RegisterCLRFieldGetter(field, get_Ratio_1);
            app.RegisterCLRFieldSetter(field, set_Ratio_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Ratio_1, AssignFromStack_Ratio_1);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIEvent.UICircleCollider());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIEvent.UICircleCollider[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* InThere_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector2 @dot = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIEvent.UserEvent @user = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Core.HGUI.UIElement @script = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIEvent.UICircleCollider instance_of_this_method = (huqiang.UIEvent.UICircleCollider)typeof(huqiang.UIEvent.UICircleCollider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.InThere(@script, @user, @dot);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static StackObject* Initial_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Data.FakeStruct @fake = (huqiang.Data.FakeStruct)typeof(huqiang.Data.FakeStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIEvent.UICircleCollider instance_of_this_method = (huqiang.UIEvent.UICircleCollider)typeof(huqiang.UIEvent.UICircleCollider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Initial(@fake);

            return __ret;
        }


        static object get_Radius_0(ref object o)
        {
            return ((huqiang.UIEvent.UICircleCollider)o).Radius;
        }

        static StackObject* CopyToStack_Radius_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIEvent.UICircleCollider)o).Radius;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Radius_0(ref object o, object v)
        {
            ((huqiang.UIEvent.UICircleCollider)o).Radius = (System.Single)v;
        }

        static StackObject* AssignFromStack_Radius_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @Radius = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIEvent.UICircleCollider)o).Radius = @Radius;
            return ptr_of_this_method;
        }

        static object get_Ratio_1(ref object o)
        {
            return ((huqiang.UIEvent.UICircleCollider)o).Ratio;
        }

        static StackObject* CopyToStack_Ratio_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIEvent.UICircleCollider)o).Ratio;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Ratio_1(ref object o, object v)
        {
            ((huqiang.UIEvent.UICircleCollider)o).Ratio = (System.Single)v;
        }

        static StackObject* AssignFromStack_Ratio_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @Ratio = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIEvent.UICircleCollider)o).Ratio = @Ratio;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIEvent.UICircleCollider();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
